<?php
include_once('../../app/connection.php');

if(isset($_POST['action']))
{
    $action = $_POST['action'];
        
    if($action == "Chỉnh sửa")
    {
        $mamh="";
        $mamh = $_POST['mamh'];
        
        $sql = "UPDATE monhoc SET TENMONHOC='".$_POST['tenmh']."', TINCHILYTHUYET='".$_POST['tclt']."', 
            TINCHITHUCHANH='".$_POST['tcth']."', HOCKY='".$_POST['hocky']."', MAKHOA='".$_POST['khoa']."',
            TRANGTHAI='".$_POST['trangthai']."' WHERE MAMONHOC='$mamh'";
        $result = mysql_query($sql) or die(mysql_error());
        
        header('Location: ../?page=quanlymh&function=ds_monhoc');
    }  
}
?>